package main;

import java.util.HashMap;

import solver.*;

public class Esercizio3 {
	
	public static void main(String[] args) {
	
		System.out.println("Esercizio 3");
		System.out.println();
		System.out.println("M/M/1/B");
		  
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.4  ----   Mu = 1.0  -----  B = 4  ----  ");
		AlgebricSolver.solve_mm1b_lk_mk(0.4,1.0,4);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.9  ----   Mu = 1.0  -----  B = 4  ----  ");
		AlgebricSolver.solve_mm1b_lk_mk(0.9,1.0,4);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 1.5  ----   Mu = 1.0  -----  B = 4  ----  ");
		AlgebricSolver.solve_mm1b_lk_mk(1.5,1.0,4);
		System.out.println("#################################################################################");
		
		String pathCsv = "C:\\Users\\fede1587\\eclipseworkspace\\Simulazione\\CSV\\matrix3.csv";
		HashMap<String,Double> variables = new HashMap<String,Double>();
		
		System.out.println();
		System.out.println();
		System.out.println("M/Er/1/B");
		  
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.4  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("lambda",0.4);
		variables.put("2mu",2.0);
		variables.put("-lambda",-0.4);
		variables.put("-lambda-2mu",-2.4);
		variables.put("-2mu",-2.0);
		MatrixSolver.solve_csv_mer1b(pathCsv,0.4,1.0,variables);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.9  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("lambda",0.9);
		variables.put("2mu",2.0);
		variables.put("-lambda",-0.9);
		variables.put("-lambda-2mu",-2.9);
		variables.put("-2mu",-2.0);
		MatrixSolver.solve_csv_mer1b(pathCsv,0.9,1.0,variables);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 1.5  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("lambda",1.5);
		variables.put("2mu",2.0);
		variables.put("-lambda",-1.5);
		variables.put("-lambda-2mu",-3.5);
		variables.put("-2mu",-2.0);
		MatrixSolver.solve_csv_mer1b(pathCsv,1.5,1.0,variables);
		System.out.println("#################################################################################");
		
		pathCsv = "C:\\Users\\fede1587\\eclipseworkspace\\Simulazione\\CSV\\matrix4.csv";
		System.out.println();
		System.out.println();
		System.out.println("M/Pipe/1/B");
		  
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.4  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("-2mu",-2.0);
		variables.put("-lambda",-0.4);
		variables.put("lambda",0.4);
		variables.put("-lambda-2mu",-2.4);
		variables.put("2mu",2.0);
		variables.put("-lambda-4mu",-4.4);
		variables.put("-4mu",-4.0);
		MatrixSolver.solve_csv_mpipe1b(pathCsv,0.4,1.0,variables);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 0.9  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("-2mu",-2.0);
		variables.put("-lambda",-0.9);
		variables.put("lambda",0.9);
		variables.put("-lambda-2mu",-2.9);
		variables.put("2mu",2.0);
		variables.put("-lambda-4mu",-4.9);
		variables.put("-4mu",-4.0);
		MatrixSolver.solve_csv_mpipe1b(pathCsv,0.9,1.0,variables);
		System.out.println("#################################################################################");
		System.out.println("  ----  Lambda = 1.5  ----   Mu = 1.0  -----  B = 4  ----  ");
		variables.put("-2mu",-2.0);
		variables.put("lambda",1.5);
		variables.put("-lambda",-1.5);
		variables.put("-lambda-2mu",-3.5);
		variables.put("2mu",2.0);
		variables.put("-lambda-4mu",-5.5);
		variables.put("-4mu",-4.0);
		MatrixSolver.solve_csv_mpipe1b(pathCsv,1.5,1.0,variables);
		System.out.println("#################################################################################");
		
	}
	

}
